package com.hctforgreen.greenservice.utils;

import android.app.Activity;
import android.content.Intent;

import com.hctforgreen.greenservice.EntryDetailV3Activity;
import com.hctforgreen.greenservice.model.EntryCatalogEntity;

public class EntryDetailUtil {
	public void startEntryDetailActivity(Activity activity,
			EntryCatalogEntity catalogEntity, boolean bUseCurrentId,
			String machineName, String sEntryTitleId, String titleContents,
			String bookId,int level) {
		Intent intent = new Intent();
		intent.setClass(activity, EntryDetailV3Activity.class);
		intent.putExtra(HctConstants.ON_ACTIVITY_KEY_ENTRY_TITLE_ID,
				sEntryTitleId);

		// DbController dbController = new DbController(mActivity);
		// BookEntity bookEntity = dbController.getBookEntity(bookId);
		// String filePath = Util.getBookLocalPath(bookEntity);

		// intent.putExtra(HctConstants.ON_ZIP_SDCARD_PATH_KEY, filePath);

		intent.putExtra(HctConstants.ON_ACTIVITY_KEY_ENTRY_CATALOG_ENTITY,
				catalogEntity);
		intent.putExtra(HctConstants.ON_ACTIVITY_KEY_ENTRY_TITLE_CONTENTS,
				titleContents);
		if (bUseCurrentId) {
			intent.putExtra(HctConstants.ON_ACTIVITY_KEY_CURRENT_BOOK_ID,
					bookId);
			intent.putExtra(HctConstants.ON_ACTIVITY_KEY_BOOK_ID, "");
		} else {
			intent.putExtra(HctConstants.ON_ACTIVITY_KEY_CURRENT_BOOK_ID, "");
			intent.putExtra(HctConstants.ON_ACTIVITY_KEY_BOOK_ID, bookId);
		}

		intent.putExtra(HctConstants.ON_ACTIVITY_KEY_SEARCH_MACHINE_NAME,
				machineName);
		intent.putExtra("level", level);
		activity.startActivity(intent);
	}
}
